﻿Imports System
Imports System.ComponentModel.Design.Serialization
Imports System.Workflow.ComponentModel

Namespace System.Workflow.ComponentModel.Serialization
    Friend NotInheritable Class ActivityMarkupSerializationProvider
        Inherits WorkflowMarkupSerializationProvider
        ' Methods
        Public Overrides Function GetSerializer(ByVal manager As IDesignerSerializationManager, ByVal currentSerializer As Object, ByVal objectType As Type, ByVal serializerType As Type) As Object
            If ((Not serializerType Is GetType(WorkflowMarkupSerializer)) OrElse (Not currentSerializer Is Nothing)) Then
                Return Nothing
            End If
            If GetType(CompositeActivity).IsAssignableFrom(objectType) Then
                Return New CompositeActivityMarkupSerializer
            End If
            If GetType(ItemList([Of] )).IsAssignableFrom(objectType) Then
                Return New CollectionMarkupSerializer
            End If
            Dim provider As IDesignerSerializationProvider = New WorkflowMarkupSerializationProvider
            Dim obj2 As Object = provider.GetSerializer(manager, currentSerializer, objectType, serializerType)
            If (Not obj2.GetType Is GetType(WorkflowMarkupSerializer)) Then
                Return obj2
            End If
            Return New ActivityMarkupSerializer
        End Function

    End Class
End Namespace

